package cn.zhiquxing.dao;

import cn.zhiquxing.domain.MessageTemplate;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface MessageTemplateDao extends JpaRepository<MessageTemplate, Long>, JpaSpecificationExecutor<MessageTemplate> {

    /**
     * 查询列表
     * @param deleted
     * @param pageable
     * @return
     */
    List<MessageTemplate> findAllByIsDeletedEqualsToOrderByUpdatedDesc(Integer deleted, Pageable pageable);

    /**
     * 统计未删除的条数
     * @param deleted
     * @return
     */
    Long countByIsDeletedEquals(Integer deleted);
}
